package com.cdtye.itps.cms.service.defect;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.cdtye.common.mybatiscore.base.BaseService;
import com.cdtye.itps.cms.dao.defect.entity.JcwProblemDefectCategory;
import com.cdtye.itps.cms.dao.defect.vo.JcwProblemDefectCategoryVo;
import com.cdtye.itps.cms.mapper.defect.JcwProblemDefectCategoryMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class JcwProblemDefectCategoryService extends BaseService<JcwProblemDefectCategoryMapper, JcwProblemDefectCategory> {

    @Autowired
    private JcwProblemDefectCategoryMapper modelMapper;

    public List<Map<String,Object>> getDefectCategoryListByIdList(List<String> idList) {
        return modelMapper.getDefectCategoryListByIdList(idList);
    }

    /**
     * 分页查询
     * @param vo
     * @return
     */
    public IPage<Map<String,Object>> pageList(JcwProblemDefectCategoryVo vo){
        return modelMapper.pageList(vo.page(),vo);
    }

    /**
     * 列表获取
     * @param vo
     * @return
     */
    public List<Map<String,Object>> getList(JcwProblemDefectCategoryVo vo){
        return modelMapper.getList(vo);
    }

    public List<JcwProblemDefectCategory> findDefectCategory(String defectCategoryName, String defectTypeCode) {
        return modelMapper.findCategoryInfo(defectTypeCode, defectCategoryName);
    }

    public JcwProblemDefectCategory getJcwProblemDefectCategoryById(String id){
        return modelMapper.selectById(id);
    }
}
